package Chapter6.complete;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

@Entity
public class AddressComplete {
	private int id;
	private String country;
	private String city;
	private Set<PublisherComplete> publisher;

	public AddressComplete() {
	}

	public AddressComplete(String country, String city) {
		this.country = country;
		this.city = city;
	}

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@OneToMany(mappedBy = "address", fetch = FetchType.LAZY)
	public Set<PublisherComplete> getPublisher() {
		return publisher;
	}

	public void setPublisher(Set<PublisherComplete> publisher) {
		this.publisher = publisher;
	}

}
